1. Field of the Invention
The present invention relates to a disparity correcting device which rapidly corrects disparity information generated on the basis of a left image and disparity information generated on the basis of a right image through a simple configuration, and a method thereof, in stereo vision which generates a 3-dimensional image using a left image and a right image captured from left and right cameras.
2. Description of the Related Art
Stereo vision is a technique of acquiring 3-dimensional information from 2-dimensional images acquired at positions different from each other at the same time using two image sensors, that is, a left camera and a right camera, and is configured to acquire depth information that is 3-dimensional distance information by finding corresponding points which correspond to the same point in the left and right images and acquiring disparity information between the two corresponding points.
FIG. 1 illustrates a disparity map based on a left image and a disparity map based on a right image in stereo vision. According to FIG. 1, a corresponding point of a right image with respect to a point A of a left image is A′, and there is a difference of 4 pixels in an x axis (a transverse direction). That is, in the left image based disparity map, coordinates about the pixel A are (14, 7), and the depth information at this position is 4. In the right image based disparity map, coordinates about the pixel A′ are (10, 7), and a disparity value at this position is 4. In this case, the corresponding points A and A′ of the left and right images have a coordinate difference in the x axis by a value of the depth information, that is, by 4 pixels according to an embodiment of FIG. 1. In addition, the corresponding point of the right image with respect to the point B of the left image is B′, coordinates about the pixel B in the left image based disparity map are (5, 4), coordinates about the pixel B′ in the right image based disparity map are (3, 4), the corresponding points B and B′ of the left and right images have a difference in coordinates in the x axis by 2 pixels, and depth information is calculated through disparity between such right image and left image.
However, generally, the left image based disparity information and the right image based disparity information generated in stereo vision have a lot of errors due to internal or external factors such as various distortion variables and parameters. A post-process is performed to correct such errors, currently a post-process most widely used in general, that is, a disparity correcting method is a left/right (L/R) cross check method.
FIG. 2 to FIG. 4 are diagrams for explaining the disparity correcting method through left/right cross check in conventional stereo vision.
FIG. 2 is a diagram exemplifying a case where an error occurs in a matching result in a left image disparity map based and a right image based disparity map in stereo matching, FIG. 3 is a diagram for explaining an error detecting method occurring in FIG. 2, and FIG. 4 is a diagram for explaining a correcting method for the error detected in FIG. 3.
That is, FIG. 2 illustrates that an error occurs in a disparity value about a point C in a left image based disparity map and an error occurs in a disparity value about a point D in a right image based disparity map.
In addition, FIG. 3 illustrates a method of detecting an error through the left/right (L/R) cross check in FIG. 2. That is, on the basis of the left image disparity map in FIG. 3, the disparity value of the point C having coordinates (10, 6) in the left image disparity map is 4, and thus the point C′ having coordinates (6, 6) moved to the left by 4 from the point having coordinates (10, 6) of the right image based disparity map is a point to be compared in value with the point C of the left image. In this case, since the disparity value of the point C′ is 2 and is not equal to the disparity value of 4 of the point C, it is determined that an error occurs.
FIG. 4 illustrates a method of correcting an error of the point C detected through the left/right cross check in FIG. 3. FIG. 3 illustrates an error state confirmed through the example of FIG. 2. In this case, when the error value is “1”, it means that an error occurs in the pixel, and when the error value is “0”, it means that an error does not occur in the pixel. A small value of the disparity values of the closest pixel in which an error does not occur is transmitted to the pixel in which an error occurs, thereby performing correction. According to FIG. 4, occurrence of an error is confirmed while moving from the left to the right of the image. When the error does not occur, a valid value is updated, and when the error occurs, the valid value is updated to the previous valid value. After the updating is completed which moving from the left to the right of the image, the same process is repeated which moving from the right to the left of the image. When moving from the right to the left of the image, a valid value to be transmitted from the right in the correction process of the point where the error occurs is compared in largeness and smallness with a valid value (a value corrected while moving from the left to the right) of the current position, it is updated to the small value. For example, the pixel where the error occurs in FIG. 4 is the point C of coordinates (10, 6), the correction of the point is updated to disparity of 2 of coordinates (9, 6) in the course of correcting while moving from the left to the right of the image, the correction is performed while moving from the left to the right in the course of correcting while moving from right to the left of the image, and thus the correction is not performed. In addition, the point D of coordinates (13, 9) is corrected to a valid value of 0 of the previous point transmitted from the right. That is, the left image based disparity map and the right image based disparity map are updated as shown in FIG. 4.
However, the left/right cross check method described above is configured to perform a disparity correcting process for each pixel while moving from the left to the right with respect to one line in stereo vision and to perform the disparity correcting process for each pixel again while moving from the right to the left, and there is a problem that a lot of time is required according to the correction process and a cost of a device in a hardware configuration is increased.